<%-- 
    Document   : produk
    Created on : Dec 18, 2013, 7:48:17 PM
    Author     : lenovo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@page import="java.util.*" %>
<%@page import="model.Produk" %>
<%@page import="database.DBClass"%>
<%@page import="validation.ValidateForm"%>
<%@ page import ="java.sql.*" %>
<html>
    <%
        Produk produk;
        produk = new Produk();
        DBClass dbobject = new DBClass();
    %>
    <head>
        <style type="text/css">
            body {
                background-color:black;
                background-image:url(images/4.jpg); 
            }
        </style>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<%request.getContextPath();%>/E-Stonion/css/metro-bootstrap.css" rel="stylesheet"> 
        <link href="<%request.getContextPath();%>/E-Stonion/css/metro-bootstrap-responsive.css" rel="stylesheet">

        <script src="<%request.getContextPath();%>/E-Stonion/js/jquery/jquery.min.js"></script>
        <script src="<%request.getContextPath();%>/E-Stonion/js/jquery/jquery.widget.min.js"></script>

        <script src="<%request.getContextPath();%>/E-Stonion/js/metro/metro-*.js"></script>
        <link href="css/docs.css" rel="stylesheet">
        <link href="js/prettify/prettify.css" rel="stylesheet">
        <!-- Load JavaScript Libraries -->
        <script src="js/jquery/jquery.min.js"></script>
        <script src="js/jquery/jquery.widget.min.js"></script>
        <script src="js/jquery/jquery.mousewheel.js"></script>
        <script src="js/prettify/prettify.js"></script>

        <!-- Metro UI CSS JavaScript plugins -->
        <script src="js/load-metro.js"></script>

        <!-- Local JavaScript -->
        <script src="js/docs.js"></script>
        <script src="js/github.info.js"></script>


        <title>Produk</title>
    </head>
    <body class="metro">
        <nav class="navigation-bar">
            <nav class="navigation-bar-content">
                <a class="element" href="/E-Stonion/home.jsp">
                    <span class="icon-grid-view"></span>
                    E-Stonion </a>
                <span class="element-divider"></span>
                <a class="element" href="home.jsp">Home</a>
                <a class="element" href="produk.jsp">Produk</a>
                <a class="element" href="koperasi.jsp">Koperasi</a>
                <a class="element" href="aboutus.jsp">About Us</a>
                <span class="element-divider"></span>
                <div class="element input-element place-right">
                    <form method="post" action="<%request.getContextPath();%>/E-Stonion/SearchServlet">
                        <div class="input-control text">
                            <input type="text" name="inputsearch" value="" placeholder="Search...">
                            <button class="btn-search" name="action" value="SearchAll"></button>
                        </div>
                    </form>
                </div>
                <span class="element-divider place-right"></span>
            </nav>
        </nav>
        <div>
            <div class="grid fluid">
                <div class="row">
                    <div class="span2">
                        <nav class="sidebar light">
                            <ul>
                                <li class="title">Pencarian Produk</li>
                                <li class="stick bg-yellow">
                                    <a class="dropdown-toggle" href="#"><i class="icon-arrow-right-3"></i>Jenis Produk</a>
                                    <ul class="dropdown-menu" data-role="dropdown">

                                        <%
                                            List list2 = dbobject.getJenis();
                                            if (list2 != null) {
                                                for (int i = 0; i < list2.size(); i++) {
                                                    Produk uproduk = (Produk) list2.get(i);
                                        %>
                                        <li><a href="SearchServlet?action=searchjenis&inputsearch=<%=uproduk.getjenisambil()%>"><%=uproduk.getjenisambil()%></a></li>
                                        <%
                                                }
                                            }
                                        %>
                                    </ul>
                                </li>

                                <li>
                                    <a class="dropdown-toggle" href="#"><i class="icon-arrow-right-3"></i>Kategori Harga</a>
                                    <ul class="dropdown-menu" data-role="dropdown">
                                        <li><a href="SearchServlet?action=searchharga&range1=0&range2=100000"><=Rp.100.000</a></li>
                                        <li><a href="SearchServlet?action=searchharga&range1=100000&range2=200000">Rp.100.000 - Rp.200.000</a></li>
                                        <li><a href="SearchServlet?action=searchharga&range1=200000&range2=300000">Rp.200.000 - Rp.300.000</a></li>
                                        <li><a href="SearchServlet?action=searchharga&range1=300000&range2=9999999999">>=Rp. 300.000</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </nav>
                    </div>
                    <div class="span9">

                        <table width="750"border="0" class="table table-striped">
                            <tr>
                                <th width="250" >Nama Produk</th>
                                <th width="250" >Jenis Produk</th>
                                <th width="250" >Harga Produk</th>
                            </tr>
                            <%
                                List list = dbobject.getAllproduk();
                                //                request.setAttribute("list", list);
                                //                List list2 = (List) request.getAttribute("list");
                                if (list != null) {
                                    for (int i = 0; i < list.size(); i++) {
                                        Produk ubean = (Produk) list.get(i);
                            %>
                            <tr>
                                <td width="250" height="200"><div align="center"><img src="images/produk/<%=ubean.getnamaproduk()%>.jpg" class="span8" class="rounded polaroid">
                                    <a href="ControllerServlet?action=detailproduk&idproduk=<%=ubean.getidproduk()%>"><%=ubean.getnamaproduk()%></a></div></td>
                                 <td width="250" height="200"><div align="center"><%=ubean.getjenisproduk()%></div></td>
                                <td width="250" height="200"><div align="center">Rp. <%=ubean.gethargaproduk()%></div></td>
                               
                            </tr>
                            <%
                                    }
                                }
                            %>
                        </table>

                    </div>

                </div>

            </div>
        </div>

    </body>
</html>
